package com.chenfei.aop.advisor;

import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;

/**
 * @author chenfei
 * @description
 * @since 2018/3/23
 */
public class MyAdvice implements AfterReturningAdvice,MethodBeforeAdvice{

    /**
     * 实现Advice的前置方法
     * @param method
     * @param objects
     * @param o
     * @throws Throwable
     */
    public void before(Method method, Object[] objects, Object o) throws Throwable {
        System.out.println("=========我是前置通知before方法=============");
    }

    /**
     * 实现Advice的后置方法
     * @param o
     * @param method
     * @param objects
     * @param o1
     * @throws Throwable
     */
    public void afterReturning(Object o, Method method, Object[] objects, Object o1) throws Throwable {
        System.out.println("=========我是后置通知afterReturn方法=============");
    }



}
